Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linter: Split ink_linting into two libraries #2032

Merged
merged 7 commits into from
Jan 3, 2024

Conversation

jubnzv
Copy link
Member

@jubnzv jubnzv commented Dec 21, 2023

Summary

Closes #2006

  • [y] y/n | Does it introduce breaking changes?
  • [n] y/n | Is it dependant on the specific version of cargo-contract or pallet-contracts?

Split ink_linting to ink_linting_mandatory and ink_linting.

Description

Mandatory lints will be integrated in the cargo-build build process in use-ink/cargo-contract#1412.

Extra lints are optional and could be run by the contract developer to highlight possible issues with secure coding style and to check the compliance with best practices.

For more information about this design decision, see: use-ink/cargo-contract#1412 (comment).

Checklist before requesting a review

  • My code follows the style guidelines of this project
  • I have added an entry to CHANGELOG.md
  • I have commented my code, particularly in hard-to-understand areas
  • I have added tests that prove my fix is effective or that my feature works
  • Any dependent changes have been merged and published in downstream modules

Split `ink_linting` to `ink_linting_mandatory` and `ink_linting`.

Mandatory lints will be integrated in the `cargo-build` build
process in use-ink/cargo-contract#1412.

Extra lints are optional and could be run by the contract developer to
highlight possible issues with secure coding style and to check the
compliance with best practices.

For more information about this design decision, see: use-ink/cargo-contract#1412 (comment).

Closes use-ink#2006
Copy link

github-actions bot commented Dec 21, 2023

🦑 📈 ink! Example Contracts ‒ Changes Report 📉 🦑

These are the results when building the integration-tests/* contracts from this branch with cargo-contract and comparing them to ink! master:

Contract Upstream Size (kB) PR Size (kB) Diff (kB) Diff (%) Change
basic-contract-caller 3.207 3.207 0 0
basic-contract-caller/other-contract 1.581 1.581 0 0
call-builder-return-value 8.904 8.904 0 0
call-runtime 2.013 2.013 0 0
conditional-compilation 1.453 1.453 0 0
contract-storage 7.336 7.336 0 0
contract-terminate 1.336 1.336 0 0
contract-transfer 1.693 1.693 0 0
custom-allocator 7.652 7.652 0 0
dns 7.321 7.321 0 0
e2e-call-runtime 1.302 1.302 0 0
e2e-runtime-only-backend 1.879 1.879 0 0
erc1155 14.129 14.123 -0.006 -0.0424659 📉
erc20 6.918 6.918 0 0
erc721 9.816 9.816 0 0
events 5.006 5.006 0 0
flipper 1.637 1.637 0 0
incrementer 1.504 1.504 0 0
lang-err-integration-tests/call-builder-delegate 2.561 2.561 0 0
lang-err-integration-tests/call-builder 5.087 5.087 0 0
lang-err-integration-tests/constructors-return-value 1.987 1.987 0 0
lang-err-integration-tests/contract-ref 4.568 4.568 0 0
lang-err-integration-tests/integration-flipper 1.815 1.815 0 0
lazyvec-integration-test 4.553 4.553 0 0
mapping-integration-tests 7.919 7.919 0 0
mother 12.756 12.756 0 0
multi-contract-caller 6.155 6.155 0 0
multi-contract-caller/accumulator 1.378 1.378 0 0
multi-contract-caller/adder 1.908 1.908 0 0
multi-contract-caller/subber 1.928 1.928 0 0
multisig 21.621 21.621 0 0
payment-channel 5.653 5.653 0 0
sr25519-verification 1.148 1.148 0 0
static-buffer 1.649 1.649 0 0
trait-dyn-cross-contract-calls 2.706 2.706 0 0
trait-dyn-cross-contract-calls/contracts/incrementer 1.549 1.549 0 0
trait-erc20 7.294 7.294 0 0
trait-flipper 1.453 1.453 0 0
trait-incrementer 1.614 1.614 0 0
upgradeable-contracts/delegator 3.152 3.152 0 0
upgradeable-contracts/delegator/delegatee 1.613 1.613 0 0
upgradeable-contracts/set-code-hash 1.747 1.747 0 0
upgradeable-contracts/set-code-hash/updated-incrementer 1.726 1.726 0 0
wildcard-selector 2.852 2.852 0 0

Link to the run | Last update: Sun Dec 24 14:26:22 CET 2023

@codecov-commenter
Copy link

codecov-commenter commented Dec 21, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (b4bc917) 53.85% compared to head (c3ac3cb) 53.65%.
Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2032      +/-   ##
==========================================
- Coverage   53.85%   53.65%   -0.20%     
==========================================
  Files         221      221              
  Lines        6958     6965       +7     
  Branches     3068     3066       -2     
==========================================
- Hits         3747     3737      -10     
- Misses       3211     3228      +17     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

jubnzv added a commit to jubnzv/cargo-contract that referenced this pull request Dec 23, 2023
ink_linting was splitted up to two libraries in use-ink/ink#2032
This is necessary, because the lockfile needs to be updated since we run
build with a different `rust-toolchain.yml`.
@jubnzv jubnzv marked this pull request as ready for review December 24, 2023 13:52
@jubnzv jubnzv requested review from cmichi, ascjones, SkymanOne and a team as code owners December 24, 2023 13:52
Copy link
Collaborator

@ascjones ascjones left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@ascjones ascjones merged commit 306145c into use-ink:master Jan 3, 2024
22 checks passed
jubnzv added a commit to jubnzv/ink that referenced this pull request Jan 15, 2024
cmichi added a commit that referenced this pull request Jan 18, 2024
* feat(linter): Automate the generation of documentation for ink-docs

This commit introduces a script that extracts documentation from
`ink_linting` lints and saves it to the local [ink-docs](https://github.com/paritytech/ink-docs) directory.

The markdown formatting of the lints was also improved.

* chore(script): Update after #2032 is merged

* chore(linter): Wrap in docstring to improve appearance

* Update scripts/generate_linter_docs.sh

---------

Co-authored-by: Michael Müller <mich@elmueller.net>
@SkymanOne SkymanOne mentioned this pull request Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Split up ink_linting into two dylint libraries
3 participants